]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionSystem: Don't load extensions multiple times
authorRay Strode <rstrode@redhat.com>
Mon, 18 Oct 2010 15:41:39 +0000 (11:41 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 18 Oct 2010 16:28:36 +0000 (12:28 -0400)
Right now if XDG_DATA_DIRS is set to have duplicate entries,
then the extension system will try to load all extensions
more than once.

This commit prevents an extension from getting repeatedly
loaded by checking if its uuid is already registered.

https://bugzilla.gnome.org/show_bug.cgi?id=632477

js/ui/extensionSystem.js

index 944e2e54636c8b708bb207d2b37de0ba73b91410..5315d90c3ef4a7bfa4a614257dfaff9c220b17e6 100644 (file)
@@ -51,6 +51,12 @@ function loadExtension(dir, enabled, type) {
             return;
         }
     }
+
+    if (extensions[meta.uuid] != undefined) {
+        global.logError(baseErrorString + "extension already loaded");
+        return;
+    }
+
     // Encourage people to add this
     if (!meta['url']) {
         global.log(baseErrorString + 'Warning: Missing "url" property in metadata.json');